var initCategoryTab = function() {
		YEvent.delegate("categoryListTable", "click", viewCategory, '.view-category-link');
		YEvent.delegate("categoryListTable", "click", assignMenus, '.assign-menus-link');
		YEvent.delegate("categoryListTable", "click", deleteCategory, '.delete-category-link');
};
	
var viewCategory = function(event) {
	
	// 'this' refers to element that was clicked
	var parentRow = getParentRow(this);
	// Make xhr call get entity details
	var id = parentRow.readAttribute("categoryId");
	getTabContent("category/edit?categoryId="+id);
	
};

var assignMenus = function(event) {
	// 'this' refers to element that was clicked
	var parentRow = getParentRow(this);
	// Make xhr call get entity details
	var id = parentRow.readAttribute("categoryId");
	getTabContent("category/assignmenus?categoryId="+id);
	
};


var createNewCategory = function() {
	goToTab("CATEGORY");
	getTabContent("category/add");
		
};

var returnToCatgoryList = function() {
	getTabContent("category");
};

var deleteCategory = function(event){
	
	
	if (confirm("Are you want to delete?")) {
		// 'this' refers to element that was clicked
		var parentRow = getParentRow(this);
		// Make xhr call get entity details
		var id = parentRow.readAttribute("categoryId");
		getTabContent("category/delete?categoryId="+id);
	} else {
		return false;
	}
};